﻿<%@ page contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html>
<head>
<title>节日优惠列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="<%=request.getContextPath()%>/style/adminStyle.css" rel="stylesheet" type="text/css" />
<script src="<%=request.getContextPath()%>/js/jquery.js"></script>
<script src="<%=request.getContextPath()%>/js/public.js"></script>
<script type="text/javascript">
function selec() {
	var sr=${admin.jurisdiction};
	 if(sr==1){
		 alert("权限不足");
		return false;
	 }else{
		 return true;
	 }
}


</script>
	

</head>
<body>
 <div class="wrap">
  <div class="page-title">
    <span class="modular fl"><i></i><em>节日优惠列表</em></span>
    <span class="modular fr"><a href="<%=request.getContextPath()%>/Administrators/coupon_addfest.do" class="pt-link-btn" onclick="return selec()">+新增节日优惠</a></span>
  </div>
  
  
  <table class="list-style Interlaced">
   
  <c:if test="${festival==null}">
  	<span style="text-align: center;display:block;color:#A4A4A4; font-size: 3em;margin-top: 15%;">哎呀，暂无节日优惠活动!</span>
  </c:if>
  <c:if test="${festival!=null}">
  <tr>
    <th>优惠节日名称</th>
    <th>优惠金额</th>
    <th>节日码</th>
    <th>备注</th>
    <th>操作</th>
   </tr>
   <tr>
   	<td align="center">${festival.usingplatform}</td>
   	<td align="center">${festival.reduction}</td>
   	<td align="center">${festival.serialnumber}</td>
   	<td align="center">${festival.remarks}</td>
    <td class="center">
    <a class="inline-block" title="删除" onclick="delets(${festival.id})"><img src="../images/icon_drop.gif"/></a>
    </td>
   </tr>
  </c:if>
  </table>
  <!-- BatchOperation -->
  <div style="overflow:hidden;">
     
	 
  </div>
 </div>
<script type="text/javascript">

delets=function(id) {
		var msg = "您确定要删除吗？\n\n请确认！";
		var sr=${admin.jurisdiction};		
		if (confirm(msg)==true){
			if(sr==1){
				  alert("权限不足");
			}else{
				$.ajax({
					"url":"${pageContext.request.contextPath}/Administrators/coupon_delete.do",
					"data":"id="+id,
					"type":"POST",
					"dataType":"json",
					"success":function(obj){

						if(obj.state==1){
							 alert("删除成功");
							 window.location="${pageContext.request.contextPath}/Administrators/coupon_festival.do"
							
						}else{
							 alert("删除失败");
						}
				
					}});
			}
		}
		}
 </script>
</body>
</html>